package com.nintendo.task;

import com.nintendo.utils.SmsUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Component
@Slf4j
public class SmsTask {
    @Resource
    private SmsUtil smsUtil;
    @Async
    public String sendSms(String mobile, HttpServletRequest request) {
        System.out.println("sendSms===================异步发送短信>"+mobile);
        return smsUtil.sendMessage(mobile,request);
    }
}
